<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="12" :lg="12" :md="12" :sm="24">
            <a-form-item label="创建日期">
              <j-date
                :show-time="true"
                date-format="YYYY-MM-DD"
                placeholder="请选择开始时间"
                class="query-group-cust"
                v-model="queryParam.createTime_begin"
              ></j-date>
              <span class="query-group-split-cust"></span>
              <j-date
                :show-time="true"
                date-format="YYYY-MM-DD"
                placeholder="请选择结束时间"
                class="query-group-cust"
                v-model="queryParam.createTime_end"
              ></j-date>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="单据编号">
                <a-input placeholder="请输入单据编号" v-model="queryParam.code"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>

      <a-button type="primary" icon="download" @click="handleExportXls('合同评审说明')">导出</a-button>
      <j-super-query
        :fieldList="superFieldList"
        ref="superQueryModal"
        @handleSuperQuery="handleSuperQuery"
      ></j-super-query>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
        >项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-tabs v-model="activeKey" @change="handleChangeTab">
        <a-tab-pane key="notGenerated" tab="暂存中">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            @change="handleTableChange1"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio' }"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <a v-if="record.status < 0" @click="handleEdit(record)">编辑</a>
              <a-divider type="vertical"></a-divider>
              <act-apply-btn
                v-show="record.status < 0"
                @success="loadData"
                :data-id="record.id"
                :serviceName="serviceName"
                :variables="record"
              ></act-apply-btn>
              <!--               <a-divider type="vertical"></a-divider>
                            <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>-->
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="printPreview(record)">打印预览</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleCopy(record)">引用</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                      <a>删除</a>
                    </a-popconfirm>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="needEdit" tab="需修改">
          <a-table
            ref="needEditTable"
            size="middle"
            bordered
            rowKey="id"
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="needEditTable.dataSource"
            :pagination="needEditTable.ipagination"
            :loading="needEditTable.loading"
            @change="handleTableChange2"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'  }"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <a v-if="record.status < 0" @click="handleEdit(record)">编辑</a>
              <a-divider v-if="record.status < 0"  type="vertical"></a-divider>
              <act-apply-btn
                v-show="record.actStatus == '撤回'"
                @success="loadData"
                :data-id="record.id"
                :serviceName="serviceName"
                :variables="record"
              ></act-apply-btn>
             <a-popconfirm  v-if="record.actStatus != '撤回'" title="确定取消申请吗?" @confirm="() => handleStop(record)" >
               <a href="javascript:;">取消申请</a>
             </a-popconfirm>
              <!--              <a-divider v-if="record.actStatus != '撤回'" type="vertical" />
                            <a v-if="record.actStatus !='撤回'" @click="handleProcess(record)">提交</a>-->
              <a-divider v-if="record.actStatus != '撤回'" type="vertical" />
              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="printPreview(record)">打印预览</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleCopy(record)">引用</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                  <a-menu-item>
                     <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                      <a>删除</a>
                    </a-popconfirm>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="approving" tab="审批中">
          <a-table
            ref="approvingTable"
            size="middle"
            bordered
            rowKey="id"
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="approvingTable.dataSource"
            :pagination="approvingTable.ipagination"
            :loading="approvingTable.loading"
            @change="handleTableChange3"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'  }"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a-popconfirm title="确定取消申请吗?" @confirm="() => handleStop(record)" v-if="record.actStatus != '撤回'">
                      <a href="javascript:;">取消申请</a>
                    </a-popconfirm>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="printPreview(record)">打印预览</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleCopy(record)">引用</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="approved" tab="已审批">
          <a-table
            ref="approvedTable"
            size="middle"
            bordered
            rowKey="id"
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="approvedTable.dataSource"
            :pagination="approvedTable.ipagination"
            :loading="approvedTable.loading"
            @change="handleTableChange4"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'  }"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="printPreview(record)">打印预览</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleCopy(record)">引用</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
      </a-tabs>
    </div>

    <buss-contract-review-des-modal ref="modalForm" @ok="modalFormOk" />
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import BussContractReviewDesModal from './modules/BussContractReviewDesModal'
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import '@/assets/less/TableExpand.less'
import ActApplyBtn from '@views/flowable/components/ActApplyBtn'
import ActCancelBtn from '@views/flowable/components/ActCancelBtn'
import ActHandleBtn from '@views/flowable/components/ActHandleBtn'
import ActHistoricDetailBtn from '@views/flowable/components/ActHistoricDetailBtn'
import { getAction, getFileAccessHttpUrl } from '@api/manage'
import { Base64 } from 'js-base64'
import store from '@/store'
import { stopProcess } from '@/views/flowable/api/process'

export default {
  name: 'BussContractReviewDesList',
  mixins: [JeecgListMixin],
  components: {
    BussContractReviewDesModal,
    ActApplyBtn,
    ActCancelBtn,
    ActHandleBtn,
    ActHistoricDetailBtn,
  },
  data() {
    return {
      pcaData: '',
      serviceName: 'contractReviewDesService',
      description: '合同评审说明管理页面',
      activeKey: 'notGenerated',
      queryParam: {
        documentType:3 //P&G国内订单
      },
      notGeneratedTable: {
        loading: false,
        dataSource: [],
        isorter: {
          column: 'createTime',
          order: 'desc',
        },
        // 表头
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['10', '20', '30','50','100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' 共' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0,
        },
      },
      needEditTable: {
        loading: false,
        dataSource: [],
        isorter: {
          column: 'createTime',
          order: 'desc',
        },
        // 表头
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['10', '20', '30','50','100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' 共' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0,
        },
      },
      approvingTable: {
        loading: false,
        dataSource: [],
        isorter: {
          column: 'createTime',
          order: 'desc',
        },
        // 表头
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['10', '20', '30','50','100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' 共' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0,
        },
      },
      approvedTable: {
        loading: false,
        dataSource: [],
        isorter: {
          column: 'createTime',
          order: 'desc',
        },
        // 表头
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['10', '20', '30','50','100'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' 共' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0,
        },
      },
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },

        {
          title: '评审说明编号',
          align: 'center',
          dataIndex: 'code',
          sorter: (a, b) => a.code.localeCompare(b.code, 'en'),
        },
        {
          title: '单据类型',
          align: 'center',
          dataIndex: 'documentType_dictText',
        },
        {
          title: '销售类型',
          align: 'center',
          dataIndex: 'salesType_dictText',
        },
        {
          title: '业务类型',
          align: 'center',
          dataIndex: 'contractBusinessType_dictText',
        },
        {
          title: '客户',
          align: 'center',
          dataIndex: 'customerId_dictText',
        },
        /*        {
                  title: '订货数量',
                  align: 'center',
                  dataIndex: 'weight',
                },
                {
                  title: '柜数',
                  align: 'center',
                  dataIndex: 'cabinetCount',
                },*/
        {
          title: '业务员',
          align: 'center',
          dataIndex: 'salesman_dictText',
        },
        {
          title: '制单人',
          align: 'center',
          dataIndex: 'createBy_dictText',
        },
        {
          title: '制单部门',
          align: 'center',
          dataIndex: 'sysOrgCode_dictText',
        },
        {
          title: '制单时间',
          align: 'center',
          dataIndex: 'createTime',
          sorter: (a, b) => a.createTime.localeCompare(b.createTime, 'en'),
        },
        /*        {
                  title: '流程状态',
                  align: 'center',
                  dataIndex: 'actStatus',
                },
                {
                  title: '待处理节点',
                  align: 'center',
                  dataIndex: 'taskName',
                },*/
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        list: '/business/bussContractReviewDes/list',
        delete: '/business/bussContractReviewDes/delete',
        deleteBatch: '/business/bussContractReviewDes/deleteBatch',
        exportXlsUrl: '/business/bussContractReviewDes/exportXls',
        importExcelUrl: 'business/bussContractReviewDes/importExcel',
      },
      dictOptions: {},
      superFieldList: [],
    }
  },
  created() {
    this.getSuperFieldList()
    let curUser = store.getters.userInfo.username
    console.log(this.queryParam.createBy,curUser)
    if (curUser != 'admin') {

      this.queryParam.createBy = curUser
      console.log(this.queryParam.createBy,curUser)
    }
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    },
  },
  methods: {
    handleTableChange1(pagination, filters, sorter) {
      //分页、排序、筛选变化时触发
      //TODO 筛选
      console.log(pagination)
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field;
        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
      }
      this.ipagination = pagination;
      this.loadNotGeneratedData();
    },
    handleTableChange2(pagination, filters, sorter) {
      //分页、排序、筛选变化时触发
      //TODO 筛选
      console.log(pagination)
      if (Object.keys(sorter).length > 0) {
        this.needEditTable.isorter.column = sorter.field;
        this.needEditTable.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
      }
      this.needEditTable.ipagination = pagination;
      this.loadNeedEditData();
    },
    handleTableChange3(pagination, filters, sorter) {
      //分页、排序、筛选变化时触发
      //TODO 筛选
      console.log(pagination)
      if (Object.keys(sorter).length > 0) {
        this.approvingTable.isorter.column = sorter.field;
        this.approvingTable.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
      }
      this.approvingTable.ipagination = pagination;
      this.loadApprovingData();
    },
    handleTableChange4(pagination, filters, sorter) {
      //分页、排序、筛选变化时触发
      //TODO 筛选
      console.log(pagination)
      if (Object.keys(sorter).length > 0) {
        this.approvedTable.isorter.column = sorter.field;
        this.approvedTable.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
      }
      this.approvedTable.ipagination = pagination;
      this.loadApprovedData();
    },
    // 跳转到处理页面
    handleProcess(row) {
      console.log(row,"提交任务节点")
      this.$router.push({
        path: '/flowable/task/record/index',
        query: {
          procInsId: row.processInstanceId,
          deployId: row.deployId,
          taskId: row.taskId,
          businessKey: row.id,
          category: 'zdyyw',
          finished: true,
        },
      })
    },
    handleStop(row) {
      const params = {
        instanceId: row.processInstanceId,
      }
      stopProcess(params).then((res) => {
        this.$message.success(res.message)
        this.loadData()
      })
    },

    handleCopy(record) {
      this.$refs.modalForm.copy(record)
    },
    handleChangeTab() {
      switch (this.activeKey) {
        case 'notGenerated':
          this.loadNotGeneratedData()
          break
        case 'needEdit':
          this.loadNeedEditData()
          break
        case 'approving':
          this.loadApprovingData()
          break
        case 'approved':
          this.loadApprovedData()
          break
        default:
          break
      }
    },
    loadNotGeneratedData() {
      //未生成单据，status=-2
      this.queryParam.status = -2
      this.queryParam.field = this.getQueryField();
      this.queryParam.pageNo = this.ipagination.current;
      this.queryParam.pageSize = this.ipagination.pageSize;

      this.loading = true
      getAction(this.url.list, this.queryParam)
        .then((res) => {
          if (res.success) {
            this.dataSource = res.result.records || res.result
            if (res.result.total) {
              this.ipagination.total = res.result.total
            } else {
              this.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        })
        .finally(() => {
          this.loading = false
        })
    },
    loadNeedEditData() {
      //需修改单据，status=-1
      this.queryParam.status = -1
      this.queryParam.field = this.getQueryField();
      this.queryParam.pageNo = this.needEditTable.ipagination.current;
      this.queryParam.pageSize = this.needEditTable.ipagination.pageSize;
      this.needEditTable.loading = true
      getAction(this.url.list, this.queryParam)
        .then((res) => {
          if (res.success) {
            this.needEditTable.dataSource = res.result.records || res.result
            if (res.result.total) {
              this.needEditTable.ipagination.total = res.result.total
            } else {
              this.needEditTable.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        })
        .finally(() => {
          this.needEditTable.loading = false
        })
    },
    loadApprovingData() {
      //审核中单据，status=0
      this.queryParam.status = 0
      this.queryParam.field = this.getQueryField();
      this.queryParam.pageNo = this.approvingTable.ipagination.current;
      this.queryParam.pageSize = this.approvingTable.ipagination.pageSize;
      this.approvingTable.loading = true
      getAction(this.url.list, this.queryParam)
        .then((res) => {
          if (res.success) {
            this.approvingTable.dataSource = res.result.records || res.result
            if (res.result.total) {
              this.approvingTable.ipagination.total = res.result.total
            } else {
              this.approvingTable.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        })
        .finally(() => {
          this.approvingTable.loading = false
        })
    },
    loadApprovedData() {
      //已审核单据，status=999
      this.queryParam.status = 999
      this.queryParam.field = this.getQueryField();
      this.queryParam.pageNo = this.approvedTable.ipagination.current;
      this.queryParam.pageSize = this.approvedTable.ipagination.pageSize;
      this.approvedTable.loading = true
      getAction(this.url.list, this.queryParam)
        .then((res) => {
          if (res.success) {
            this.approvedTable.dataSource = res.result.records || res.result
            if (res.result.total) {
              this.approvedTable.ipagination.total = res.result.total
            } else {
              this.approvedTable.ipagination.total = 0
            }
          } else {
            this.$message.warning(res.message)
          }
        })
        .finally(() => {
          this.approvedTable.loading = false
        })
    },
    async loadData() {
      //分别根据单据状态查询结果并将其放在
      this.queryParam = this.getQueryParams()
      this.handleChangeTab()
    },
    reverseCheck() {
      if (this.selectedRowKeys.length < 1) {
        this.$message.error('请选择后再进行撤销审核操作')
        return
      }
      if (this.selectedRowKeys.length > 1) {
        this.$message.error('撤销审核最多只能选择一条记录')
        return
      }
      getAction('/business/bussContractReviewDes/reverseCheck', { id: this.selectedRowKeys[0] }).then((res) => {
        if (res.success) {
          this.$message.success(res.message)
          this.loadData()
        } else {
          this.$message.error(res.message)
        }
      })
    },
    printPreview(record) {
      // if (this.selectedRowKeys.length < 1) {
      //   this.$message.error('请选择后再预览')
      //   return
      // }
      // if (this.selectedRowKeys.length > 1) {
      //   this.$message.error('打印预览时最多只能选择一条记录')
      //   return
      // }

      let token = store.getters.token
      let id = record.id
      window.open(`${window._CONFIG['domianURL']}/jmreport/view/970575111953915904?token=${token}&id=${id}`, '_blank')
    },
    relationAct(r) {
      getAction('/business/bussContractReviewDes/relationAct', { dataId: r.id }).then((res) => {
        if (res.success) {
          this.$message.success('操作成功')
          this.loadData()
        } else {
          this.$message.error('操作失败')
        }
      })
    },
    initDictConfig() {},
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'createBy', text: '创建人', dictCode: '' })
      fieldList.push({ type: 'datetime', value: 'createTime', text: '创建日期' })
      fieldList.push({ type: 'string', value: 'sysOrgCode', text: '所属部门', dictCode: '' })
      fieldList.push({ type: 'string', value: 'code', text: '单据编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'customerId', text: '客户', dictCode: 'erp_customer,name,id' })
      fieldList.push({ type: 'Text', value: 'formulaReq', text: '配方要求', dictCode: '' })
      fieldList.push({ type: 'Text', value: 'packReq', text: '包装要求', dictCode: '' })
      fieldList.push({ type: 'BigDecimal', value: 'weight', text: '重量', dictCode: '' })
      fieldList.push({ type: 'string', value: 'weightUnit', text: '重量单位', dictCode: 'zl_unit' })
      fieldList.push({ type: 'string', value: 'cabinetCount', text: '柜数', dictCode: '' })
      fieldList.push({ type: 'string', value: 'extra', text: '柜数单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'transactionMethod', text: '成交方式', dictCode: '' })
      fieldList.push({ type: 'string', value: 'shipPort', text: '发货港', dictCode: '' })
      fieldList.push({ type: 'string', value: 'destPort', text: '目的港', dictCode: '' })
      fieldList.push({ type: 'string', value: 'financeRemark', text: '财务备录', dictCode: '' })
      fieldList.push({ type: 'string', value: 'payMethod', text: '付款方式', dictCode: '' })
      fieldList.push({ type: 'int', value: 'daysArrival', text: '到货后付全款天数', dictCode: '' })
      fieldList.push({ type: 'string', value: 'deliveryTime', text: '交货期', dictCode: '' })
      fieldList.push({ type: 'string', value: 'overflowShort', text: '溢短装', dictCode: '' })
      fieldList.push({ type: 'string', value: 'customer', text: '客户类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'desFlowType', text: '流程类型', dictCode: 'constract_des_flow_type' })
      this.superFieldList = fieldList
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
